﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace UseIconFile
{
    public partial class Form1 : Form
    {
        string iconFilePath = "..\\..\\ico\\";
        string fileName = "1.ico";
        public Form1()
        {
            InitializeComponent();
            Image im = Image.FromFile(iconFilePath + fileName);
            pictureBox1.Image = im;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            fileName = fileName == "1.ico" ? "2.ico" : "1.ico";
            Image im = Image.FromFile(iconFilePath + fileName);
            pictureBox1.Image = im;
        }
    }
}
